home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 3
/
Amoszine 3.adf
/
Celebrity_source
/
dual_playfield.AMOS
/
dual_playfield.amosSourceCode
Wrap
AMOS Source Code
|
1992-02-26
|
5KB
|
200 lines
' **************************************************************
'
' Dual Playfield Example
'
' by Paul Nordovics
'
' **************************************************************
'
' ********************
' set up source screen
' ********************
Screen Open 2,320,256,4,Lowres
Curs Off : Flash Off : Hide
Screen Hide
Cls 0 : Paper 0 : Pen 1
Print " HALL OF FAME"
Print "PSN...........999999"
Print "SIN...........888888"
Print "NIB...........777777"
Print "AVH...........666666"
Print "NSD...........555555"
Print "DRI...........444444"
Print "OZZ...........333333"
Print "SEN...........222222"
Print "TAS...........111111"
Print "AAA...........000000"
'
' *************************************
' set up bottom layer of dual playfield
' *************************************
Screen Open 1,320,512,2,Lowres
Curs Off : Flash Off
Colour 0,0 : Colour 1,0
'
' *************************
' draw chequerboard pattern
' *************************
_INK=0
For Y=0 To 15
For X=0 To 20
Cls _INK,X*16,Y*16 To(X*16)+16,(Y*16)+16
_INK=1-_INK
Next X
Next Y
'
' **************************************
' copy top half of screen to bottom half
' **************************************
Screen Copy 1,0,0,320,255 To 1,0,256
'
' **********************************
' set up top layer of dual playfield
' **********************************
Screen Open 0,320,256,4,Lowres
Curs Off : Flash Off
Cls 0 : Paper 0
'
Wait Vbl
Dual Playfield 0,1
Screen Display 0,128,40,320,256
'
' ******************
' set screen colours
' ******************
Screen 0
Colour 1,$FFF
Colour 9,0
'
' ********************************
' set up rainbow with dummy values
' ********************************
Set Rainbow 0,9,256,"","",""
'
' ***********
' load values
' ***********
Restore CLIST
For K=0 To 255
V=15
If K<32 or K>223
Read V
End If
Rain(0,K)=V
Next K
'
' ************
' show rainbow
' ************
Rainbow 0,0,40,256
'
' ********************************************************
' bottom layer is scrolled using AMAL i.e interrupt driven
' ********************************************************
OFFSET$="A:LY=0;B:LY=Y+R0;IY>256JA;P;JB"
_SCROLL_SPEED=1
Channel 0 To Screen Offset 1
Amal 0,OFFSET$
Amreg(0,0)=_SCROLL_SPEED
Amal On 0
'
Wait 50
'
' *********
' main loop
' *********
Do
' ************************
' call screen copy routine
' ************************
_APPEAR[2,0,0,160,88,0,80,64,1,0]
'
Wait 150
'
' **************************
' fade colour 1 of top layer
' **************************
Repeat
Wait 3
V=Colour(1)
Add V,-$111
Colour 1,V
Until Colour(1)=0
'
' *******
' tidy up
' *******
Cls 0
Colour 1,$FFF
'
Wait 50
Loop
'
Procedure _APPEAR[SOURCE,X1,Y1,X2,Y2,DEST,X,Y,SPEED,_DIRECTION]
If _DIRECTION=0
LINE_SOURCE=Y1
LINE_START=Y+(Y2-Y1)
LINE_END=Y
Repeat
For K=LINE_START To LINE_END Step -1
Screen Copy SOURCE,X1,LINE_SOURCE,X2+1,LINE_SOURCE+1 To DEST,X,K
Next K
If SPEED>0
Wait SPEED
End If
Inc LINE_END
Inc LINE_SOURCE
Until LINE_END=LINE_START+1
End If
If _DIRECTION=1
LINE_SOURCE=Y2
LINE_START=Y
LINE_END=Y+(Y2-Y1)
Repeat
For K=LINE_START To LINE_END Step 1
Screen Copy SOURCE,X1,LINE_SOURCE,X2+1,LINE_SOURCE+1 To DEST,X,K
Next K
If SPEED>0
Wait SPEED
End If
Dec LINE_END
Dec LINE_SOURCE
Until LINE_END=LINE_START-1
End If
If _DIRECTION=2
LINE_SOURCE=X2
LINE_START=X
LINE_END=X+(X2-X1)
Repeat
For K=LINE_START To LINE_END Step 1
Screen Copy SOURCE,LINE_SOURCE,Y1,LINE_SOURCE+1,Y2+1 To DEST,K,Y
Next K
If SPEED>0
Wait SPEED
End If
Dec LINE_END
Dec LINE_SOURCE
Until LINE_END=LINE_START-1
End If
If _DIRECTION=3
LINE_SOURCE=X1
LINE_START=X+(X2-X1)
LINE_END=X
Repeat
For K=LINE_START To LINE_END Step -1
Screen Copy SOURCE,LINE_SOURCE,Y1,LINE_SOURCE+1,Y2+1 To DEST,K,Y
Next K
If SPEED>0
Wait SPEED
End If
Inc LINE_END
Inc LINE_SOURCE
Until LINE_END=LINE_START+1
End If
End Proc
'
' -------------------------------------------------------------
'
CLIST:
Data 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15
Data 15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0